package com.capybara.account.model.dto;

import com.capybara.account.model.entity.AuUser;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户
 *
 * @author wgc
 * @since 2024-09-12
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class AuUserDTO extends AuUser {

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Min(value = 50, message = "用户名长度不能超过50")
    private String username;
    /**
     * 实际名称
     */
    @NotBlank(message = "真实姓名不能为空")
    private String actualName;

    /**
     * 手机号码
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确")
    private String phone;

    /**
     * 身份证号码
     */
    @Pattern(regexp = "^\\d{18}$", message = "身份证号码格式不正确")
    private String identityCard;

    /**
     * 邮箱
     */
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", message = "邮箱格式不正确")
    private String email;
}
